/**
 * 
 */
package com.jbat.gwt.tiledmapcreator.client.views;

import com.jbat.gwt.tiledmapcreator.client.activities.EditMapActivityMapper;
import com.jbat.gwt.tiledmapcreator.client.activities.TileSetActivityMapper;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;

/**
 * 
 */
public class DesignView extends Composite {

  interface DesignViewImplUiBinder extends UiBinder<Widget, DesignView> {
  }

  private static DesignViewImplUiBinder uiBinder = GWT.create(DesignViewImplUiBinder.class);

  @UiField
  DockLayoutPanel dockPanel;

  @UiField
  ScrollPanel tileSetDisplayPanel;
  @UiField
  SimplePanel editDisplayPanel;

  @Inject
  public DesignView(TileSetActivityMapper tileSetActivityMapper,
      EditMapActivityMapper editMapActivityMapper, EventBus eventBus) {
    initWidget(uiBinder.createAndBindUi(this));

    ActivityManager tileSetActivityManager = new ActivityManager(tileSetActivityMapper, eventBus);
    tileSetActivityManager.setDisplay(tileSetDisplayPanel);

    ActivityManager editMapActivityManager = new ActivityManager(editMapActivityMapper, eventBus);
    editMapActivityManager.setDisplay(editDisplayPanel);
  }
}
